package com.baidu.health.mapper;

import com.baidu.health.pojo.TbCaseContent;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

/**
 * @Entity com.baidu.health.pojo.TbCaseContent
 */
@Mapper
public interface TbCaseContentMapper extends BaseMapper<TbCaseContent> {

    @Delete("delete from tb_case_content where caseid=#{caseid}")
    void deleteByCaseId(Integer caseid);

    @Select("select * from tb_case_content where caseid=#{caseid}")
    List<TbCaseContent> caseContentBycaseid(Integer caseid);

    @Update("update from set state=0 tb_case_content where caseid=#{caseid} ")
    void updateBystate(Integer cid);
    @Select("select * from tb_case_content where typeid=1")
    List<TbCaseContent> selectyd();
    @Select("select * from tb_case_content where typeid=4")
    List<TbCaseContent> selectydd();
    @Select("select * from tb_case_content where typeid=3")
    List<TbCaseContent> selectydc();
    @Select("select * from tb_case_content where typeid=2")
    List<TbCaseContent> selectydb();

    @Update("update tb_case_content set deleted=0 where id=#{id}")
    void caseContentDeleted(Integer id);

    @Select("select * from tb_case_content where id=#{id}")
    List<TbCaseContent> selectByid(Integer id);
}




